<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

        // 获取分页数据
        $pager=new SoDataPager(request_numeric('page'));
        
        $dataset=$this->dm->select_pagingset($pager->pageid,$pager->pagesize,$pager->recordcount,'tgeneralarticle','CreatedTime desc','ID, Title, VisitCount, State, CreatedTime');        
        $pager->set_dataset($dataset,$pager->recordcount);
        $this->assign('pager',$pager->get_pager_text($this->set_url_param(array('page'=>'.pageid.'))));
        
        // 构建数据表格
        //$this->uig->begin_table();
        //$this->uig->add_thead('#','标题','浏览量','日期','状态','管理');
        
        if($dataset){
            $biz=new SoBizCommon();
            foreach($dataset as $row){
                $this->uig->add_trow($row['ID'],$row['Title'],$row['VisitCount'],$row['CreatedTime'],$biz->switch_state(array('v'=>$row['State'],'group'=>array('0'=>'关闭','1'=>'正常'))),$this->get_control_linkbuttons($row['ID'],$row['Title'],'Article' ));
            }
        }
        //$this->uig->end_table();
        $this->assign('table',$this->uig->get_text());
